/*
 *  Cero Project - Copyright   2006 The Cero Developement Team 
 *  (Michael Laguerre, Camille Roux, Matthieu Segret, Mathieu Sivade) 
 * 
 *  This program is free software; you can redistribute it and/or modify it 
 *  under the terms of the GNU General Public License as published by the Free 
 *  Software Foundation; either version 2 of the License, or (at your option) 
 *  any later version.
 * 
 *  This program is distributed in the hope that it will be useful, but 
 *  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 
 *  or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 
 *  for more details.
 */

package org.ceroproject.ui.graphical.tools;

import java.awt.*;
import java.util.List;

import javax.swing.JPanel;

import org.ceroproject.games.GameListener;
import org.ceroproject.games.Zone;
import org.ceroproject.ui.graphical.tools.layout.*;


/**
 * Abstract class which creates the graphical appearance of the game's deck
 * 
 * @author Matt
 */

public abstract class Deck extends JPanel implements GameListener {

	/* -------------- field ------------- */

	private InputConverter inputConverter;

	/* ----------- Constructor ---------- */

	/**
	 * Constructor for objects of class Deck.
	 */
	public Deck() {

		this.setFocusable(true);
		inputConverter = new InputConverter(this);

		this.addMouseListener(inputConverter);
		this.addKeyListener(inputConverter);
	}

	/* ------------- Method ------------- */

	/**
	 * Return the input converter
	 * 
	 * @return the input converter
	 */
	public InputConverter getInputConverter() {
		return inputConverter;
	}

	/**
	 * Return the Deck Layout
	 * 
	 * @return the DeckLayout
	 */
	public abstract DeckLayout getDeckLayout();

	/**
	 * Define the layout of this deck
	 * 
	 * @param DeckLayout
	 *            the deckLayout to modify
	 */
	public abstract void setDeckLayout(DeckLayout deckLayout);

	/**
	 * Change a layoutZone of a Graphical Zone
	 * 
	 * @param gZone
	 *            graphical Zone that the zonelayout have to change
	 * @param zoneLayout
	 *            ZoneLayout which specifies how graphical cards are displayed
	 */
	public abstract void setZoneLayout(GraphicsZone gZone, ZoneLayout zoneLayout);

	/**
	 * Get the graphical zone associated with the specified zone
	 * 
	 * @param the
	 *            specified zone associated with the graphical zone
	 */
	public abstract GraphicsZone getGZone(Zone zone);

	/**
	 * Get the graphical zones list
	 * 
	 * @return the graphical zones list
	 */
	public abstract List<GraphicsZone> getGraphicsZoneList();

	/**
	 * Add a Graphical Zone to the Deck
	 * 
	 * @param zone
	 *            the zone to Graphical Zone to add
	 */
	public abstract void add(GraphicsZone gZone);

	/**
	 * Paint the Deck background
	 * 
	 * @param g
	 *            Graphics needed to paint the background
	 */
	public abstract void paintBackGround(Graphics g);

	/**
	 * Paint the Deck
	 * 
	 * @param g
	 *            Graphics needed to paint the Deck
	 */
	public abstract void paint(Graphics g);

}
